Repository navigation
fix(all): return the property members of an entity in a stable order - #5331
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two compilations of the same project can give different output. For example, in
tests/Js/Mainthe case test of aTypeScriptTaggedUnionwas"width" in xin one compilation and"height" in xin the next.FCS returns the property symbols from
FSharpEntity.MembersFunctionsAndValuesin an order that changes from one process to the next.PropertyCollectorinInfoReader.fskeeps them in aConcurrentDictionarykeyed by the property name hash, and .NET randomizes string hashes per process.Helpers.getMembersFunctionsAndValuesnow sorts the property symbols by declaration position. The other symbols keep their position.FsEntandgetAllInterfaceMembersuse it, so all targets get the change.There is no new test, because both orders give correct code. I compiled a small project 5 times for JavaScript and 5 times for Dart, and the outputs were identical.